package com.oascarmovie;

import android.os.Handler;
import android.os.Message;

public class LoadingThread extends Thread {
  private Handler uiThreadHandler = null;

  private Object obj = null;

  private boolean stop = false;

  public LoadingThread(Handler uiThreadHandler) {
    this.uiThreadHandler = uiThreadHandler;
  }

  public Object getObj() {
    return obj;
  }

  public void setObj(Object obj) {
    this.obj = obj;
  }

  public boolean isStop() {
    return stop;
  }

  public void setStop(boolean stop) {
    this.stop = stop;
  }

  @Override
  public void run() {
    Message message = Message.obtain(uiThreadHandler);
    message.what = Constants.MESSAGE_WHAT_LOADING;
    message.obj = this.obj;
    message.setTarget(uiThreadHandler);
    uiThreadHandler.sendMessage(message);
  }
}
